//
//  NSDate+convenience.h
//  Calendar-Demo
//
//  Created by unbank on 15-7-13.
//  Copyright (c) 2015年 ***. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef NS_ENUM(NSInteger, ComparisonResult)
{
    ComparisonResultBefore      = 1,
    ComparisonResultSame       = 2,
    ComparisonResultLater       = 3
};

@interface NSDate (convenience)

- (NSDate *)offsetMonth:(int)numMonths;
- (NSDate *)offsetDay:(int)numDays;
- (NSDate *)offsetHours:(int)hours;
- (NSInteger)numDaysInMonth;
- (NSInteger)firstWeekDayInMonth;
- (NSInteger)year;
- (NSInteger)month;
- (NSInteger)day;

- (NSDate *)setDay:(NSInteger)day;
- (NSDate *)setMonth:(NSInteger)month;
- (NSDate *)setYear:(NSInteger)year;


- (ComparisonResult )compareToDay:(NSDate *)date;
- (ComparisonResult )compareToMonth:(NSDate *)date;
- (ComparisonResult )compareToYear:(NSDate *)date;

//yyyy-hh-mm
- (NSString *)separatorStyleDateTimeString;
//yyyy-hh-mm hh:mm
- (NSString *)separatorStyleDateTimeStringToMinAndSec;

+ (NSDate *)dateStartOfDay:(NSDate *)date;
+ (NSDate *)dateStartOfWeek;
+ (NSDate *)dateEndOfWeek;
+ (NSDate *)getNowTime;//获取当前时间

- (NSDate *)getLocalDateFromAnyDate:(NSDate *)anyDate;

// 日期之间间隔多少天
+ (NSInteger)daysBetweenDate:(NSDate*)fromDateTime andDate:(NSDate*)toDateTime;


@end
